local baobian = fk.CreateSkill {

  name = "joy__baobian",

  tags = { Skill.Compulsory, },

}



baobian:addEffect(fk.Damaged, {
  name = "joy__baobian",
  anim_type = "masochism",
  frequency = Skill.Compulsory,
  events = {fk.Damaged},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(baobian.name) and
      table.find({"joy__tiaoxin", "joyex__paoxiao", "joyex__shensu"}, function(s) return not player:hasSkill(s, true) end)
  end,
  on_use = function(self, event, target, player, data)
    for _, s in ipairs({"joy__tiaoxin", "joyex__paoxiao", "joyex__shensu"}) do
      if not player:hasSkill(s, true) then
        player.room:handleAddLoseSkills(player, s, nil, true, false)
        return
      end
    end
  end,
})

return baobian